import os
import time

from selenium import webdriver
# from selenium.webdriver.common.by import By
# print(os.path.abspath(__file__))
#
#
#
# file1 = os.path.dirname(os.path.abspath(__file__)) +'/弹窗处理.py'
from selenium.webdriver.common.by import By
file1 =os.path.join(os.path.dirname(os.path.abspath(__file__))) + '/弹窗处理.py'

driver = webdriver.Chrome()
url = "file:///" + os.path.abspath("../html1") + "/upload_file.html"
# driver.get(url)
# driver.find_element(By.NAME, 'file').send_keys(file1)
# time.sleep(2)
#
# # driver.quit()
driver.get(url)
file1 = os.path.dirname(os.path.abspath(__file__)) + '/cookie操作.py'
driver.find_element(By.NAME, 'file').send_keys(file1)
time.sleep(3)



